<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a chdb instance</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.chdb.html">chdb</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="chdb.get.html">chdb::get</a></div>
 <div class="up"><a href="class.chdb.html">chdb</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="chdb.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">chdb::__construct</h1>
  <p class="verinfo">(PECL chdb &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">chdb::__construct</span> &mdash; <span class="dc-title">Creates a <a href="class.chdb.html" class="classname">chdb</a> instance</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-chdb.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>chdb::__construct</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$pathname</code></span>
   )</div>

  <p class="para rdfs-comment">
   Loads a chdb file, by mapping it into memory.
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <p class="para">
     While some validity checks are performed on the specified file, they are
     mostly there to avoid the possibility of common mistakes (for example,
     loading a file which is not a chdb database, or that is somehow
     incompatible with the current system). A maliciously crafted chdb file can
     thus be dangerous if loaded, so chdb files should be trusted and treated
     with the same security protections used for PHP shared libraries.
    </p>
   </p></blockquote>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-chdb.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">pathname</code></em></dt>

    <dd>

     <p class="para">
      The name of the file to load.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 errors" id="refsect1-chdb.construct-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws an exception in case the chdb file hasn&#039;t been successfully loaded.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    A valid chdb file might fail to load in case it was created on an
    architecture with a different endianness, with a different version of chdb,
    or if the file is too big to be mapped into memory (mostly in case of huge
    files and 32-bit architectures). In these cases the load will fail by
    throwing an exception, but otherwise not performing any illegal operation.
   </p>
  </p></blockquote>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.chdb.html">chdb</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="chdb.get.html">chdb::get</a></div>
 <div class="up"><a href="class.chdb.html">chdb</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
